package com.example.kt_user.viewmodel

import com.example.kt_common.base.BaseViewModel
import com.example.kt_common.network.RespStateData
import com.example.kt_user.bean.request.LoginReq
import com.example.kt_user.bean.response.LoginRes
import com.example.kt_user.repo.LoginRepo


/**
 * Created by stew on 8/21/22.
 * mail: stewforani@gmail.com
 */
class LoginViewModel(private val repo: LoginRepo) : BaseViewModel() {
    var captchaData = RespStateData<String>()
    var loginData = RespStateData<String>()


    fun captcha() {
        launch(block = {
            repo.captcha(captchaData)
        })
    }

    fun login(loginReq: LoginReq) {
        launch(block = {
            repo.login(loginReq, loginData)
        })
    }
}